package number

import (
	"strconv"
	"strings"
)

type Int64 int32

func (t *Int64) UnmarshalJSON(data []byte) (err error) {
	value := string(data)
	value = strings.ReplaceAll(value, "\"", "")
	if value == "" || value == "0" || value == "string" {
		*t = 0
		return nil
	}
	f, _ := strconv.ParseFloat(value, 64) //string转float32
	*t = Int64(f)
	return nil
}
